CREATE EXTERNAL TABLE jms_dwd.dwd_wide_barscan_operations_hist_dt(
  `scan_type` string COMMENT '扫描类型',
  `billcode` string COMMENT '运单号',
  `network_code` string COMMENT '网点编码',
  `network_type` string COMMENT '网点类型',
  `scan_time` string COMMENT '扫描时间',
  `recordid` string COMMENT '记录编号',
  `packagecode` string COMMENT '所属袋号',
  `nextstationcode` string COMMENT '上下一站编号',
  `nextstation` string COMMENT '上一站或下一站',
  `destination` string COMMENT '目的地点',
  `scanusercode` string COMMENT '扫描雇员编号',
  `scanuser` string COMMENT '扫描雇员',
  `source` string COMMENT '来源',
  `weight` string COMMENT '重量',
  `expresstype` string COMMENT '快件类型',
  `returnflag` string COMMENT '退件标识',
  `elescaleflag` string COMMENT '电子秤标识',
  `pistolid` string COMMENT '巴枪ID',
  `transfercode` string COMMENT '转单号',
  `is_sign` smallint COMMENT '签收标识,1是，0否',
  `input_time` timestamp COMMENT '运单录入时间',
  `operation_dt` string COMMENT '操作日期',
  `sendcustomer` string COMMENT '寄件客户',
  `subbillcode` string COMMENT '子单号',
  `roadsection_id` bigint COMMENT '路段编号',
  `planned_arrival_time` timestamp COMMENT '规划到达时间',
  `actual_arrival_time` timestamp COMMENT '实际到达时间',
  `planned_departure_time` timestamp COMMENT '规划离���时间',
  `actual_departure_time` timestamp COMMENT '实际离开时间',
  `latest_arrival_time` timestamp COMMENT '最后到达时间',
  `table_type` int COMMENT '支干线类型',
  `vehicleline_code` string COMMENT '线路编码',
  `vehicleline_name` string COMMENT '线路名称',
  `shipment_name` string COMMENT '任务号名称',
  `is_transfer` int COMMENT '是否中转 1是 0否',
  `check_flag` string COMMENT '到发一体标识')
COMMENT '运单操作汇总表,记录运单所有操作,时间范围30天，粒度：运单+操作'
PARTITIONED BY (
  `dt` string COMMENT '操作扫描录入时间，yyyy-MM-dd')
STORED AS parquet
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_dwd.db/external/dwd_wide_barscan_operations_hist_dt';